<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../session.jsp"%>
<!DOCTYPE html>
<html lang="ko">
  <head>
  	<%@ include file="../head.jsp"%>${alert}
  </head>
  <body>
  	<%@ include file="../menu.jsp"%>
	<div class="container">
		<div class="page-header">
			<h2>기타관리</h2>
		</div>

		<form id="updateEtc" class="form-horizontal" role="form" method="post" action="listEtc.do">
			<fieldset>
				<div class="form-group">
					<label for="facebookLink" class="col-md-2 control-label">페이스북 페이지 링크</label>
					<div class="col-md-10">
						<input type="text" class="form-control" name="facebookLink" value="${facebook}"/>
					</div>
				</div>

				<div class="form-group">
					<label for="partnerLink" class="col-md-2 control-label">제휴문의 링크</label>
					<div class="col-md-10">
						<input type="text" class="form-control" name="partnerLink" value="${partner}"/>
					</div>
				</div>
				
				<div class="form-group">
					<label for="glowmeeIntroLink" class="col-md-2 control-label">글로우미 인트로 이미지</label>
					<div class="col-md-10">
						<input type="text" class="form-control" name="glowmeeIntroLink" value="${introimage}"/>
					</div>
				</div>
				
				<div class="form-group">
					<label for="iosVersion" class="col-md-2 control-label">아이폰</label>
					<div class="col-md-10">
						<input type="text" class="form-control" name="iosVersion" value="${iphone}"/>
					</div>
				</div>

				<div class="form-group">
					<label for="androidVersion" class="col-md-2 control-label">안드로이드</label>
					<div class="col-md-10">
						<input type="text" class="form-control" name="androidVersion" value="${android}"/>
					</div>
				</div>

				<div class="form-group">
					<div class="col-md-offset-2 col-md-10">
						<div class="row">
							<div class="col-md-6">
								<button type="submit" class="btn btn-primary btn-block">저장하기</button>
							</div>
							<div class="col-md-6">
								<button type="reset" class="btn btn-warning btn-block">다시작성</button>
							</div>
						</div>

					</div>
				</div>
			</fieldset>
		</form>
	</div>
	<!-- Javascript -->
	<script src="assets/js/jquery.js"></script>
	<script src="assets/js/bootstrap.min.js"></script>
	<!-- 형식검사 클래스 참조 -->
	<script src="assets/js/string.js"></script>
	<script type="text/javascript">
		$(function() {
			$("#updateEtc").submit(function() {
				
				if (!$("input[name='facebookLink']").val().isValue()) {
					alert("페이스북 주소를 입력하세요.");
					$("input[name='facebookLink']").focus();
					return false;
				}
				
				if (!$("input[name='partnerLink']").val().isValue()) {
					alert("제휴문의 링크를 입력하세요.");
					$("input[name='partnerLink']").focus();
					return false;
				}
				
				if (!$("input[name='glowmeeIntroLink']").val().isValue()) {
					alert("글로우미 인트로 이미지를 입력하세요.");
					$("input[name='glowmeeIntroLink']").focus();
					return false;
				}
				
				if (!$("input[name='iosVersion']").val().isValue()) {
					alert("아이폰 버전을 입력하세요.");
					$("input[name='iosVersion']").focus();
					return false;
				}
				
				if (!$("input[name='androidVersion']").val().isValue()) {
					alert("안드로이드 버전을 입력하세요.");
					$("input[name='androidVersion']").focus();
					return false;
				}
				
				if (!confirm("정말 수정하시겠습니까?")) {
					return false;
				}
				
			});
		});
	</script>
  </body>
</html>